package cn.gcc.domain;

/**
 * Code that Changed the World
 * Pro said
 * Created by Pro on 2017-07-25.
 */
public class User {

    private String username;
    private String password;
    private int age;
    private Car car;

    public User() {
//        System.out.println("User()");
    }

    public User(String username, Car car) {
//        System.out.println("User(String username, Car car)");
        this.username = username;
        this.car = car;
    }

    public Car getCar() {
        return car;
    }

    public void setCar(Car car) {
        this.car = car;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void init(){
        System.out.println("调用了初始化方法");
    }


    public void destroy(){
        System.out.println("调用了销毁方法");
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", age=" + age +
                ", car=" + car +
                '}';
    }
}
